<?php
/**
 * @package WordPress
 * @subpackage Default_Theme
 */

$content_width = 450;

automatic_feed_links();

if ( function_exists('register_sidebar') ) {
	register_sidebar(array(
		'before_widget' => '<li id="%1$s" class="widget %2$s">',
		'after_widget' => '</li>',
		'before_title' => '<h2 class="widgettitle">',
		'after_title' => '</h2>',
	));
}

function get_page_template_color() {
	global $wp_query;

	$id = (int) $wp_query->post->ID;
	$template = get_post_meta($id, '_wp_page_template', true);
	
	if($template == "landing.php" || $template == "blue-template.php" || $template == "" || $template == "default"){
		$body_class = "bg-body";
	}else if($template == "orange-template.php"){
		$body_class = "orange-bg-body";
	}else if($template == "pink-template.php"){
		$body_class = "pink-bg-body";
	}else if($template == "green-template.php") {
		$body_class = "green-bg-body";
	}
	
	
	return $body_class;
}


function get_page_depth() {
	
	global $wp_query;
	$object = $wp_query->get_queried_object();
	$parent_id  = $object->post_parent;
	$depth = 0;
	while ($parent_id > 0) {
		$page = get_page($parent_id);
		$parent_id = $page->post_parent;
		$depth++;
	}

	return $depth;

}

function mytheme_comment($comment, $args, $depth) {

   $GLOBALS['comment'] = $comment; ?>
   <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
     <div id="comment-<?php comment_ID(); ?>">
      <div class="comment-author">
         <?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>
     </div>
	 <br />
	 <?php printf(__('<strong>%s</strong> <span class="says">says:</span>'), get_comment_author_link()) ?>
	  
      <?php if ($comment->comment_approved == '0') : ?>
         <em><?php _e('Your comment is awaiting moderation.') ?></em>
         <br />
      <?php endif; ?>

      <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"><small style="font-size:10px;"><?php printf(__('%1$s at %2$s'), get_comment_date(),  get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),'  ','') ?></div></small>
		<br />
      <?php comment_text() ?>

      <div class="reply">
        <small> <?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></small>
      </div>
	  <br />
     </div>
<?php
        }
